<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition	template="/layouts/CrudIncluirAlterar.xhtml">
	<ui:param name="bean" value="#{ManageEmpresa}" />
	
	<ui:define name="breadcrumb_content">
		<h:outputLink value="/cpp-web/pages/cadastros.jsf" title="Cadastros">Cadastros</h:outputLink>
			<h:outputText> » </h:outputText>
		<h:outputLink value="#" styleClass="active">
			<h:outputText value="Incluindo Empresa" rendered="#{bean.dadosForm.newRecord}"></h:outputText>
			<h:outputText value="Alterando Empresa" rendered="#{not bean.dadosForm.newRecord}"></h:outputText>
		</h:outputLink>
	</ui:define>

	<ui:define name="quick_links">
		<ui:include src="/layouts/cadastros_links.xhtml" />
	</ui:define>

	<ui:define name="CAMPOS">
		<fieldset id="dados">
		<span class="warning">* os itens marcados são obrigatórios</span>
			<ul>
				<li><h:outputLabel value="Nome:" ><span class="required">*</span></h:outputLabel>
					<h:inputText
					value="#{bean.dadosForm.nome}" />
				</li>
				<li><h:outputLabel value="Nome Fantasia:" ><span class="required">*</span></h:outputLabel>
					<h:inputText
					value="#{bean.dadosForm.nomeFantasia}" />
				</li>
				<li><h:outputLabel value="Telefone:" ></h:outputLabel>
					<h:inputText
					value="#{bean.dadosForm.telefone}" />
				</li>
				<li><h:outputLabel value="Responsável:" ></h:outputLabel>
					<h:inputText
					value="#{bean.dadosForm.nomeResponsavel}" />
				</li>
				<h:panelGroup rendered="#{SessionUser.usuario.administrador}" >
					<li><h:outputLabel value="Diretoria:" ><span class="required">*</span></h:outputLabel>
						<h:selectOneMenu  value="#{bean.dadosForm.diretoria}" converter="SimpleIndexConverter">
							<f:selectItem itemValue="#{null}" itemLabel="Selecione um Item"/>
							<t:selectItems value="#{bean.diretorias}" 
							itemLabel="#{item.nome}" itemValue="#{item}" var="item" />
						</h:selectOneMenu>
					</li>
				</h:panelGroup>
			</ul>
		</fieldset>
	</ui:define>
</ui:composition>

</html>
